

@RestController
@RequestMapping("/umsRolePermission")
public class UmsRolePermissionController {

    @Resource
    private UmsRolePermissionService umsRolePermissionService;


    /**
     * 获取 UmsRolePermission 分页列表
     */
    @GetMapping("/pagination")
    public Ret getUmsRolePermissionPagination( PaginationVo paginationVo, UmsRolePermissionQuery umsRolePermissionQuery ) throws Exception {
        IPage page = umsRolePermissionService.getUmsRolePermissionPagination(paginationVo, umsRolePermissionQuery );
        return Ret.toPage(page);
    }


    /**
     * 获取 UmsRolePermission 所有数据
     */
    @GetMapping("/all")
    public Ret getUmsRolePermissionAllList( UmsRolePermissionQuery umsRolePermissionQuery ) throws Exception {
        List<UmsRolePermissionEntity> list = umsRolePermissionService.getUmsRolePermissionAllList( umsRolePermissionQuery );
        return Ret.ok(list);
    }



    /**
     * 获取 UmsRolePermission 详情
    */
   @GetMapping("/{id}")
   public Ret getUmsRolePermissionDetail(@PathVariable Long id) throws Exception {

       UmsRolePermissionEntity umsRolePermission = umsRolePermissionService.getUmsRolePermissionDetail(id);
       return Ret.ok(umsRolePermission);
   }


    /**
     * 新增 UmsRolePermission
     * */
    @PostMapping("")
    public Ret addUmsRolePermission(@RequestBody UmsRolePermissionVo umsRolePermissionVo) throws Exception {

        umsRolePermissionService.addUmsRolePermission(umsRolePermissionVo);
        return Ret.ok();
    }


    /**
     * 更新 UmsRolePermission
     * */
    @PutMapping("")
    public Ret updateUmsRolePermission(@RequestBody UmsRolePermissionVo umsRolePermissionVo) throws Exception {

        umsRolePermissionService.updateUmsRolePermission(umsRolePermissionVo);
        return Ret.ok();
    }


    /**
     * 删除 UmsRolePermission
     * */
    @PostMapping("/batchRemove")
    public Ret batchRemoveUmsRolePermission( @RequestBody List<Long> ids ) throws Exception {

        umsRolePermissionService.batchRemoveUmsRolePermission(ids);
        return Ret.ok();
    }
}

  